<template>
    <div>
        <div class="mui-numbox" data-numbox-min='1' style="height:30px">
			<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
			<input id="test" class="mui-input-numbox" type="number" :value="ProductCount"  @change="change" ref="input"/>
			<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
		</div>
    </div>
</template>
   
<script>
import mui from '../../lib/mui/js/mui.min.js'
     export default {
        mounted: function(){
            mui('.mui-numbox').numbox()
        },
        methods: {
            //这个是监听input里的值改变的方法
            change: function(){
                var id= this.id
                var value= this.$refs.input.value
                //传过去的参数：1，商品的id，2，input 的值
                this.$store.commit('updataCouunt',{id,value})
            }
        },
        props: ["ProductCount","id"]
    }
</script>
<style lang="scss" scoped>
    
</style>